package com.neiquan.backstage.platform_alliance_member.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neiquan.backstage.common.util.ExtraSpringHibernateTemplate;
import com.neiquan.backstage.platform_alliance_member.PlatformAllianceMemberService;
import com.neiquan.backstage.pub.bsc.dao.po.PlatformAllianceMember;

@Service
public class PlatformAllianceMemberServiceImpl implements PlatformAllianceMemberService {
	private static Class<?> poc = PlatformAllianceMember.class;
	@Autowired
	private ExtraSpringHibernateTemplate extraSpringHibernateTemplate;

	@Override
	public PlatformAllianceMember queryById(Integer memberId) {
		return extraSpringHibernateTemplate.findFirstOneByPropEq(poc, "memberId", memberId);
	}

	@Override
	public PlatformAllianceMember queryByName(String name) {
		return extraSpringHibernateTemplate.findFirstOneByPropEq(poc, "name", name);
	}

	@Override
	public PlatformAllianceMember queryByUuid(String uuid) {
		return extraSpringHibernateTemplate.findFirstOneByPropEq(poc, "uuid", uuid);
	}

	@Override
	@SuppressWarnings("unchecked")
	public List<PlatformAllianceMember> queryAllAllianceMember() {
		return (List<PlatformAllianceMember>) extraSpringHibernateTemplate.findAll(poc);
	}
}
